package com.jsmtr.rms.service;

import com.jsmtr.rms.entity.*;
import net.sf.json.JSONArray;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface IPaperManageService {
    /**
     * 获取试卷列表
     * @param page
     * @param limit
     * @param position
     * @param purpose
     * @param keyWord
     * @param orderKey
     * @param orderType
     * @return
     * @throws Exception
     */
    Map<String, Object> getPaperList(int page, int limit, String position, Integer purpose, String keyWord
            , String orderKey, String orderType) throws Exception;

    /**
     * 获取知识点
     * @param page
     * @param limit
     * @param pname
     * @return
     * @throws Exception
     */
    Map<String, Object> getKnowList(int page, int limit,String pname) throws Exception;

    /**
     * 新增试卷
     * @param paperManageTemp
     * @param paperListTemp
     * @param request
     * @return
     */
    Integer addPaper(PaperManage paperManageTemp, List<PaperContent> paperListTemp,List<QuestionBank> questionBankList, HttpServletRequest request);

    /**
     * 修改编辑试卷
     * @param paperManageTemp
     * @param paperListTemp
     * @return
     */
    boolean editPaper(PaperManage paperManageTemp,List<PaperContent> paperListDel,List<PaperContent> paperListTemp,
                      List<QuestionBank> questionBankList,List<PaperTopic> paperTopicListTemp);

    /**
     * 删除试卷
     * @param paperIDs
     * @return
     */
    boolean delPaper(String[] paperIDs);

    /**
     * 停用试卷
     * @param paperIDs
     * @return
     */
    boolean editClosePaper(String[] paperIDs);

    /**
     * 管理更新试卷
     * @param paperTopicList
     * @param jsonArray
     * @return
     * @throws Exception
     */
    boolean editTopic(List<PaperTopic> paperTopicList, JSONArray jsonArray) throws Exception;

    /**
     * 随机试卷更新
     * @return
     * @throws Exception
     */
    List<PaperTopic> editTopicRandom(PaperManage paperManageTemp, List<PaperContent> paperListTemp,
                            List<PaperTopic> paperListDel, List<QuestionBank> questionBankList) throws Exception;

    /**
     * 获取试卷列表
     * @param paperID
     * @return
     * @throws Exception
     */
    PaperManage getPaperManage(String paperID) throws Exception;

    /**
     * 获取试卷内容列表
     * @param paperID
     * @return
     * @throws Exception
     */
    List<PaperContent> getPapers(String paperID) throws Exception;

    /**
     * 分类获取试卷章节
     * @param paperID
     * @return
     * @throws
     */
    List<PaperContent> getPaperTexts(String paperID,String topicType) throws Exception;

    /**
     * 获取试卷章节名称
     * @param paperID
     * @return
     * @throws Exception
     */
    List<PaperContent> getPaperCTByChapter(String paperID) throws Exception;

    /**
     * 获取试卷知识点
     * @param paperID
     * @return
     * @throws Exception
     */
    List<PaperContent> getPaperCTByKnow(String paperID) throws Exception;

    /**
     * 获取岗位列表
     * @return
     * @throws Exception
     */
    List<BaseJob> getJobs() throws Exception;

    /**
     * 获取题目列表
     * @return
     * @throws Exception
     */
    List<PaperTopic> getPaperTopicList(String pid,String orderKey) throws Exception;
    /**
     * 获取题目列表
     * @return
     * @throws Exception
     */
    List<PaperTopic> getPaperTopicListByType(String pid,String type) throws Exception;

    /**
     * 获取题目列表
     * @return
     * @throws Exception
     */
    List<QuestionBank> getTopicListByKidType(String[] kid, String type) throws Exception;
    /**
     * 获取题目名称
     * @return
     * @throws Exception
     */
    List<QuestionBank> getTopicListByKid(String[] kid) throws Exception;
    /**
     * 获取题目名称
     * @return
     * @throws Exception
     */
    List<QuestionBank> getTopicListByKidPosition(String kid, String type,String position) throws Exception;
    /**
     * 获取题目名称
     * @return
     * @throws Exception
     */
    List<QuestionBank>  getTopicList(String[] id) throws Exception;

    /**
     * 获取题目名称
     * @return
     * @throws Exception
     */
    List<QuestionBank>  getTopicList(String kid) throws Exception;
    /**
     * 获取题目名称
     * @return
     * @throws Exception
     */
    QuestionBank  getQuestion(String id) throws Exception;

    /**
     * 获取题目
     * @return
     * @throws Exception
     */
    PaperTopic getTopicByTPid(String tid,String pid) throws Exception;

    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
    List<KnowManage> getKnowManageList() throws Exception;

    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
    List<KnowManage> getKnowManageList(String[] id) throws Exception;
    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
    List<Knowledge> getKnowledgeListGroup(String name) throws Exception;
    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
    List<Knowledge> getKnowledgeList(String[] kids,String name) throws Exception;
    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
    KnowManage getKnowManageByID(String id) throws Exception;

    /**
     * 获取知识点管理列表
     * @return
     * @throws Exception
     */
   KnowManage getKnowManageByName(String name) throws Exception;

    /**
     * 获取问题列表
     * @param kid
     * @param type
     * @param num
     * @return
     * @throws Exception
     */
    List<QuestionBank> getQuestionListRandom(String[] kid, String[] type, Integer[] num,String position) throws Exception;

    /**
     * 获取问题列表
     * @param page
     * @param limit
     * @param keyKonwledgeID
     * @param typeStr
     * @param keyLevel
     * @param keyWord
     * @return
     * @throws Exception
     */
    Map<String, Object> getQuestionList(int page, int limit, String keyKonwledgeID, Integer keyLevel,
                                              String typeStr, String keyWord, String position) throws Exception;

}
